#ifndef _REGIONPANEL_
#define	_REGIONPANEL_

#include "Graphics/UI/UI.hpp"
#include "Objects/RegionManager.hpp"
#include "EditorRegion.hpp"
#include "Utilities/StringHelper.hpp"
#include "EditorRegionManager.hpp"
#include <vector>

/**
* Panel displaying list of regions in a Map.
*/
class RegionPanel: public Panel{
protected:
    Label title;
    EditorRegionManager* regionManager;
public:
    RegionPanel();
    
	/** List of regions in the map. */
    std::vector<EditorRegion*> regions;
	/** List of labels describing regions in the map. */
    std::vector<Label*> regionLabels;

    /** Stack panel with stack of all region labels. */
	StackPanel listPanel;
	/** Scroll panel containing the listPanel to allow for scrolling. */
    ScrollPanel listContainer;
    
    void setRegionManager(EditorRegionManager* manager);
    void addRegion(EditorRegion* region);
	void removeRegion(EditorRegion* region);
    virtual bool trapped(InterfaceEvent* event);
	void redraw();
};

#endif

